\(\int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx\) [13]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 38 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=\frac {a \cot (x)}{b^2}-\frac {\cot ^2(x)}{2 b}-\frac {\left (a^2+b^2\right ) \log (a+b \cot (x))}{b^3} \]

[Out]

a*cot(x)/b^2-1/2*cot(x)^2/b-(a^2+b^2)*ln(a+b*cot(x))/b^3

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3587, 711} \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=-\frac {\left (a^2+b^2\right ) \log (a+b \cot (x))}{b^3}+\frac {a \cot (x)}{b^2}-\frac {\cot ^2(x)}{2 b} \]

[In]

Int[Csc[x]^4/(a + b*Cot[x]),x]

[Out]

(a*Cot[x])/b^2 - Cot[x]^2/(2*b) - ((a^2 + b^2)*Log[a + b*Cot[x]])/b^3

Rule 711

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1+\frac {x^2}{b^2}}{a+x} \, dx,x,b \cot (x)\right )}{b} \\ & = -\frac {\text {Subst}\left (\int \left (-\frac {a}{b^2}+\frac {x}{b^2}+\frac {a^2+b^2}{b^2 (a+x)}\right ) \, dx,x,b \cot (x)\right )}{b} \\ & = \frac {a \cot (x)}{b^2}-\frac {\cot ^2(x)}{2 b}-\frac {\left (a^2+b^2\right ) \log (a+b \cot (x))}{b^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.23 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.26 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=\frac {2 a b \cot (x)-b^2 \csc ^2(x)+2 \left (a^2+b^2\right ) (\log (\sin (x))-\log (b \cos (x)+a \sin (x)))}{2 b^3} \]

[In]

Integrate[Csc[x]^4/(a + b*Cot[x]),x]

[Out]

(2*a*b*Cot[x] - b^2*Csc[x]^2 + 2*(a^2 + b^2)*(Log[Sin[x]] - Log[b*Cos[x] + a*Sin[x]]))/(2*b^3)

Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.39

method result size
default \(-\frac {1}{2 b \tan \left (x \right )^{2}}+\frac {\left (a^{2}+b^{2}\right ) \ln \left (\tan \left (x \right )\right )}{b^{3}}+\frac {a}{b^{2} \tan \left (x \right )}-\frac {\left (a^{2}+b^{2}\right ) \ln \left (\tan \left (x \right ) a +b \right )}{b^{3}}\) \(53\)
risch \(\frac {2 i a \,{\mathrm e}^{2 i x}+2 b \,{\mathrm e}^{2 i x}-2 i a}{\left ({\mathrm e}^{2 i x}-1\right )^{2} b^{2}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) a^{2}}{b^{3}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{b}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right ) a^{2}}{b^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{b}\) \(125\)

[In]

int(csc(x)^4/(a+b*cot(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2/b/tan(x)^2+(a^2+b^2)/b^3*ln(tan(x))+1/b^2*a/tan(x)-(a^2+b^2)/b^3*ln(tan(x)*a+b)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 118 vs. \(2 (36) = 72\).

Time = 0.28 (sec) , antiderivative size = 118, normalized size of antiderivative = 3.11 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=-\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) - b^{2} + {\left ({\left (a^{2} + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - b^{2}\right )} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - {\left ({\left (a^{2} + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - b^{2}\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right )}{2 \, {\left (b^{3} \cos \left (x\right )^{2} - b^{3}\right )}} \]

[In]

integrate(csc(x)^4/(a+b*cot(x)),x, algorithm="fricas")

[Out]

-1/2*(2*a*b*cos(x)*sin(x) - b^2 + ((a^2 + b^2)*cos(x)^2 - a^2 - b^2)*log(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos
(x)^2 + a^2) - ((a^2 + b^2)*cos(x)^2 - a^2 - b^2)*log(-1/4*cos(x)^2 + 1/4))/(b^3*cos(x)^2 - b^3)

Sympy [F]

\[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=\int \frac {\csc ^{4}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \]

[In]

integrate(csc(x)**4/(a+b*cot(x)),x)

[Out]

Integral(csc(x)**4/(a + b*cot(x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.37 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=-\frac {{\left (a^{2} + b^{2}\right )} \log \left (a \tan \left (x\right ) + b\right )}{b^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (\tan \left (x\right )\right )}{b^{3}} + \frac {2 \, a \tan \left (x\right ) - b}{2 \, b^{2} \tan \left (x\right )^{2}} \]

[In]

integrate(csc(x)^4/(a+b*cot(x)),x, algorithm="maxima")

[Out]

-(a^2 + b^2)*log(a*tan(x) + b)/b^3 + (a^2 + b^2)*log(tan(x))/b^3 + 1/2*(2*a*tan(x) - b)/(b^2*tan(x)^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 78 vs. \(2 (36) = 72\).

Time = 0.25 (sec) , antiderivative size = 78, normalized size of antiderivative = 2.05 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=\frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right )}{b^{3}} - \frac {{\left (a^{3} + a b^{2}\right )} \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a b^{3}} - \frac {3 \, a^{2} \tan \left (x\right )^{2} + 3 \, b^{2} \tan \left (x\right )^{2} - 2 \, a b \tan \left (x\right ) + b^{2}}{2 \, b^{3} \tan \left (x\right )^{2}} \]

[In]

integrate(csc(x)^4/(a+b*cot(x)),x, algorithm="giac")

[Out]

(a^2 + b^2)*log(abs(tan(x)))/b^3 - (a^3 + a*b^2)*log(abs(a*tan(x) + b))/(a*b^3) - 1/2*(3*a^2*tan(x)^2 + 3*b^2*
tan(x)^2 - 2*a*b*tan(x) + b^2)/(b^3*tan(x)^2)

Mupad [B] (verification not implemented)

Time = 12.12 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.16 \[ \int \frac {\csc ^4(x)}{a+b \cot (x)} \, dx=-\frac {\frac {1}{2\,b}-\frac {a\,\mathrm {tan}\left (x\right )}{b^2}}{{\mathrm {tan}\left (x\right )}^2}-\frac {2\,\mathrm {atanh}\left (\frac {2\,a\,\mathrm {tan}\left (x\right )}{b}+1\right )\,\left (a^2+b^2\right )}{b^3} \]

[In]

int(1/(sin(x)^4*(a + b*cot(x))),x)

[Out]

- (1/(2*b) - (a*tan(x))/b^2)/tan(x)^2 - (2*atanh((2*a*tan(x))/b + 1)*(a^2 + b^2))/b^3